const net = require('net');


const clientServer = net.createServer(socket => {
    console.log('客户端已连接');
    socket.on('end', () => {
        console.log('客户端已断开连接');
    });
    socket.pipe(socket);
});

module.exports = {
    start(port) {
        clientServer.listen(port, () => {
            console.log('本地服务器已启动');
        });
    },
    stop() {
        clientServer.close();
    }
};




